package com.kingsoft.dc.khaos.module.spark.constants

/**
  * create by yansu on 2020/07/15 15:48
  */
object KafkaConstants {
  // kafka配置相关参数
  final val BOOTSTRAP_SERVER = "bootstrap.servers"
  final val GROUP_ID = "group.id"
  final val SESSION_TIMEOUT_MS = "session.timeout.ms"
  final val KEY_DESERIALIZER = "key.deserializer"
  final val VALUE_DESERIALIZER = "value.deserializer"
  final val AUTO_OFFSET_RESET = "auto.offset.reset"
  final val EARLIEST = "earliest"
  final val ACKS = "request.required.acks"

  //kerberos认证相关配置
  final val SECURITY_PROTOCOL = "security.protocol"
  final val SASL_KERBEROS_SERVICE_NAME = "sasl.kerberos.service.name"
  final val SASL_MECHANISM = "sasl.mechanism"
  final val JAVA_SECURITY_KRB5_CONF = "java.security.krb5.conf"
  final val REQUEST_TIMEOUT_MS = "request.timeout.ms"
  final val JAVA_SECURITY_AUTH_LOGIN_CONFIG = "java.security.auth.login.config"

  // kafka topic数据管理相关参数
  final val DATA_FORMAT = "DATA_FORMAT"
  final val PARTITION_SIZE = "PARTITION_SIZE"
  final val CSV_DELIMITER = "CSV_DELIMITER"

  final val CSV = "csv"
  final val JSON = "json"
  final val PARTITIONS_OFFSET = "partitionAndOffset"

  // offset mysql配置相关参数
  final val MYSQL_OFFSET_FILE = "di_kafka.properties"
  final val HOST = "host"
  final val PORT = "port"
  final val USERNAME = "username"
  final val PASSWORD = "password"
  final val DB_NAME = "db_name"
  final val TBL_NAME = "tbl_name"
  final val TBL_NAME_TEST = "di_offset_test"
  final val TBL_NAME_ONLINE = "di_offset_online"
  final val DEFAULT_API_OUT_TIME = "defaultApiOutTime"

  final val MODULE_KAFKA_SOURCE_MYSQL_HOST = "module.kafka.source.mysql.host"
  final val MODULE_KAFKA_SOURCE_MYSQL_PORT = "module.kafka.source.mysql.port"
  final val MODULE_KAFKA_SOURCE_MYSQL_USERNAME = "module.kafka.source.mysql.username"
  final val MODULE_KAFKA_SOURCE_MYSQL_PASSWORD = "module.kafka.source.mysql.password"
  final val MODULE_KAFKA_SOURCE_MYSQL_DBNAME = "module.kafka.source.mysql.dbname"
  final val MODULE_KAFKA_SOURCE_MYSQL_TBLNAME = "module.kafka.source.mysql.tblname"
  final val MODULE_KAFKA_SOURCE_MYSQL_JDBC_DRIVER = "module.kafka.source.mysql.jdbc.driver"
  final val MODULE_KAFKA_SOURCE_MYSQL_JDBC_URL_PARAM = "module.kafka.source.mysql.jdbc.url.param"
  final val MODULE_KAFKA_SOURCE_COMMON_PUBLIC_KDE_REALM = "module.kafka.source.common.public.kde.realm"
  final val MODULE_KAFKA_SOURCE_CONSUMER_PER_NUMS = "module.kafka.source.consumer.per.nums"
  final val MODULE_KAFKA_SOURCE_SESSION_TIMEOUT = "module.kafka.source.session.timeout"
  final val MODULE_KAFKA_SOURCE_DEAFULT_API_TIMEOUT = "module.kafka.source.deafult.api.timeout"
  final val MODULE_KAFKA_SOURCE_POLL_TIMEOUT = "module.kafka.source.poll.timeout"
  final val MODULE_KAFKA_SOURCE_POLL_RETRY_TIMES = "module.kafka.source.poll.retry.times"

  // mysql表字段
  final val PARTITIONS = "partitions"
  final val OFFSET = "offset"

}
